package cn.springdemo.test;

import cn.springdemo.beans.User;
import cn.springdemo.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class testAOP {

    @Test
    public void test() {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("context.xml");
        UserService userService = (UserService) context.getBean("userService");
        userService.addUser(new User());
    }

    @Test
    public void test01() {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("context.xml");
        UserService userService = (UserService) context.getBean("userService");
        userService.addUser(new User());
        User user = (User) context.getBean("user");
        System.out.println(user.toString());

    }



}
